-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix problem that NewReplicaSet shows <none> when describing deployments #97752
Conversation
Hi @borgerli. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cc |
/retest |
/assign @eddiezane |
@eddiezane Other than the above, lgtm. Will wait your opinion about improving the unit tests so future bugs can be catched earlier :) |
Thanks for the comment. I'll add the unit test. |
@rikatz I just modified the test case of TestDescribeDeployment by covering the NewReplicaSet info verification. Please review. Thanks. |
@borgerli Thanks, will review. Can you please edit the RELEASE NOTE block on the description of the PR and add a "NONE" into that? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@borgerli thank you again.
I've left one review about the test. To be honest, I would expect that we test the whole output instead of only one field, so we can detect other deviations / bugs caused by future changes, there's some example on the test I've mentioned before.
If you need some help with that please let me know.
Thank you!
@@ -1719,6 +1806,10 @@ func TestDescribeDeployment(t *testing.T) { | |||
if !strings.Contains(out, "bar") || !strings.Contains(out, "foo") || !strings.Contains(out, "Containers:") || !strings.Contains(out, "mytest-image:latest") { | |||
t.Errorf("unexpected out: %s", out) | |||
} | |||
expectedNewReplicaSet := "NewReplicaSet: bar-001 (1/1 replicas created)" | |||
if !strings.Contains(out, expectedNewReplicaSet) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this seems a good approach. I'm mostly biased to have a comparison between the full output instead of only the NewReplicaSet string, so we can validate the behavior of the whole describe command instead of only one line (we want to get all divergences instead of only this line, right?)
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, agreed. I'll improve the test case to validate all computed fields. Thank you.
/release-note-none |
@borgerli let me know when the tests are ready :) |
@rikatz Sorry that I'm busy with work this week. I'll try to get tests ready by this Sunday. |
/retest |
@rikatz I improved the test case. Please help review. Thanks. |
Will review today |
/triage accepted |
/lgtm Thanks! |
/cc |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: borgerli, pwittrock The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest
Em qua., 20 de jan. de 2021 às 13:09, Kubernetes Prow Robot <
notifications@github.com> escreveu:
… @borgerli <https://github.com/borgerli>: The following test *failed*, say
/retest to rerun all failed tests:
Test name Commit Details Rerun command
pull-kubernetes-bazel-build a286455
<a286455>
link
<https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/97752/pull-kubernetes-bazel-build/1351922938080661504> /test
pull-kubernetes-bazel-build
Full PR test history
<https://prow.k8s.io/pr-history?org=kubernetes&repo=kubernetes&pr=97752>. Your
PR dashboard
<https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Aborgerli>.
Please help us cut down on flakes by linking to
<https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests>
an open issue
<https://github.com/kubernetes/kubernetes/issues?q=is:issue+is:open> when
you hit one in your PR.
Instructions for interacting with me using PR comments are available here
<https://git.k8s.io/community/contributors/guide/pull-requests.md>. If
you have questions or suggestions related to my behavior, please file an
issue against the kubernetes/test-infra
<https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:>
repository. I understand the commands that are listed here
<https://go.k8s.io/bot-commands>.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#97752 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWZQBIVUDDGTKJKXNMFCQTS2353JANCNFSM4VW3PITA>
.
|
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #97750
Special notes for your reviewer:
The cause of issue #97750 is that the
sort.Sort
calls indescribeDeployment->DescribePodTemplate->describeContainers->describeContainerVolumes
could change the order of the items in VolumeMounts array of containers, which will fail theequalIgnoreHash
comparison infindNewReplicaSet
. As a result, no new replicaset could be found, and the NewReplicaSet will show as .So the fix is just pass the deep copy of the deployment object when calling
describeDeployment